$.ajax({
    url: Feng.ctxPath + "/caseSelection/getMarkList",
    type: "post",
    success: function (data) {
        var li = "";
        for (var i = 0; i < data.length; i++) {
            li += '<li id="' + data[i].customMark + '" style="position: relative"><a href="javascript:;">' + data[i].customMark + '</a><span class="glyphicon glyphicon-remove" style="position: absolute;top: 50%;right: 10px;transform: translateY(-50%)"></span></li>'
        }
        $("#dropdownMenu2Ul").html(li)
    },
    error: function (data) {
        alert('内部故障!');
    }
});
$("#dropdownMenu2").on('click', 'li', function () {
    var value = $(this).attr('id');
    $("#mark").val($("#mark").val()+" "+value);
});
function getExplanationPage(label) {
    var index = layer.open({
        type: 2,
        title: '&nbsp',
        area: ['40%', '40%'],
        fix: true,
        maxmin: true,
        content: Feng.ctxPath + '/caseSelection/getExplanationPage/' + label
    });
    this.layerIndex = index;
}
function addMark() {
    var index = layer.open({
        type: 2,
        title: '&nbsp',
        area: ['40%', '40%'],
        fix: true,
        maxmin: true,
        content: Feng.ctxPath + '/caseSelection/to_mark_label/'
    });
    this.layerIndex = index;
}
function minimumValue(obj) {
    if(parseInt($(obj).val()) > 100){
        $(obj).val($(obj).siblings('.ratingItemsScore1').val());
    } else {
        $(obj).siblings('.ratingItemsScore1').val($(obj).val());
    }
}
$("#dropdownMenu2Ul").on('click','.glyphicon-remove',function (e) {
    e.stopPropagation();
    var mark = $(this).parent().attr('id');
    if (confirm("是否删除此模板？")) {
        $.ajax({
            url: Feng.ctxPath + "/caseSelection/deleteMarkLabel",
            type: "post",
            data:{
                mark:mark
            },
            success: function (data) {
                Feng.success("删除成功!");
                window.location.reload();
            },
            error: function (data) {
            }
        });
    }
});